<#include "include/macros.ftl">
<@header title="${config.siteName?if_exists} | ${config.authorName?if_exists}的个人博客"
keywords="${config.homeKeywords?if_exists}"
description="${config.homeDesc?if_exists}"
canonical="/${url?if_exists}">
</@header>

<div class="container custome-container">
    <!--[if lt IE 9]>
    <div class="alert alert-danger topframe" role="alert">Oh My God！你的浏览器实在<strong>太太太太太太旧了</strong>，赶紧升级浏览器 <a
            target="_blank" class="alert-link" href="http://browsehappy.com">立即升级</a></div><![endif]-->
<#if config.maintenance?if_exists && config.maintenance>
    <div class="alert alert-warning fade-in" role="alert">
        <a href="#" class="close" data-dismiss="alert">&times;</a>
        系统预计将在<strong>${config.maintenanceData?string('yyyy年MM月dd日 HH点mm分')}</strong>进行更新，届时网站将无法使用，更新时间大约 5-10分钟，敬请悉知。
    </div>
</#if>
<@advertTag method="getList" positionKey="BLOG_INDEX_TOP_TEXT">
 <nav class="breadcrumb">
     <div class="notify"><i class="fa fa-volume-up"></i></div>
     <div id="scrolldiv">
         <div class="scrolltext">
             <ul class="list-unstyled" id="notice-box">
                    <#if advertList?? && advertList?size gt 0>
                        <#list advertList as advert>
                        <li class="scrolltext-title">
                            <a href="${advert.link!'javascript:void(0)'}" rel="bookmark"
                               target="_blank">${advert.title!'...'}</a>
                        </li>
                        </#list>
                    <#else>
                        <li class="scrolltext-title">
                            <a href="javascript:void(0)" rel="bookmark">本站正式启用新域名:<a href="http://www.ldzhao.com"
                                                                                     target="_blank"><strong>http://www.ldzhao.com</strong></a></a>
                        </li>
                    </#if>
             </ul>
         </div>
     </div>
 </nav>
</@advertTag>
    <div class="row">
        <div class="col-sm-8 blog-main">
            <div class="blog-body expansion" style="padding: 0;">
                <#if haveCarousel?? && haveCarousel=='Y'>
<@advertTag method="getList" positionKey="BLOG_INDEX_CAROUSEL">
    <#if advertList?? && advertList?size gt 0>
                <div id="myCarousel" class="carousel slide" style="height:350px;">
                    <ol class="carousel-indicators">
                    <#list advertList as carousel>
                        <li data-target="#myCarousel" data-slide-to="${carousel_index}"
                            <#if carousel_index==0>class="active"</#if>></li>
                    </#list>
                    </ol>
                    <div class="carousel-inner">
                    <#list advertList as carousel>
                        <div <#if carousel_index==0>class="item active" <#else>class="item" </#if>>
                            <a href="${carousel.link!'javascript:void(0)'}">
                                <img src="${carousel.pic}" style="width: 100%"
                                     alt="${carousel.title}" title="${carousel.title}">
                            </a>
                            <div class="blogweb-carousel-caption">${carousel.title}</div>
                        </div>
                    </#list>
                    </div>
                    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                        <span class="fa fa-angle-left fa-fw fa-3x" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
                        <span class="fa fa-angle-right fa-fw fa-3x" aria-hidden="true"></span>
                        <span class="sr-only">Next</span>
                    </a>
                </div>
    </#if>
</@advertTag>
                </#if>
            </div>
        <#if page.list?exists && (page.list?size > 0)>
            <#list page.list as item>
            <article class="fade-in">
                <figure class="thumbnail">
                    <a href="${config.siteUrl}/article/${item.id?c}">
                    <#if item.coverImage?exists && (item.coverImage?length > 7)>
                        <img width="150" height="150"
                             data-original="${config.qiuniuBasePath}${item.coverImage}"
                             class="img-responsive lazy-img" alt="${item.title?if_exists}">
                    <#else>
                        <img width="150" height="150"
                             data-original="${config.staticWebSite}/images/default_article_cover.jpg"
                             class="img-responsive lazy-img" alt="${item.title?if_exists}">
                    </#if>
                    </a>
                    <span class="cat"><a
                            href="${config.siteUrl}/type/${item.typeId?c}">${item.type.name}</a></span>
                </figure>
                <header class="entry-header">
                    <h2 class="entry-title">
                        <a href="${config.siteUrl}/article/${item.id?c}" rel="bookmark" title="点击查看文章详情"
                           data-toggle="tooltip" data-placement="bottom">${item.title}</a>
                    </h2>
                </header>
                <div class="entry-content">
                    <div class="archive-content">
                        ${item.description?if_exists}
                    </div>
                    <span class="title-l"></span>
                    <span class="entry-meta">
                                 <#--<#if article.original?string('true','false') == 'true'>-->
                                 <#--<li><i class="fa fa-user fa-fw"></i>刘钊 </li>-->
                                 <#--<#else>-->
                                 <#--<li><i class="fa fa-user fa-fw"></i> ${article.author!'佚名'}</li>-->
                                 <#--</#if>-->
                                <span class="comment" title="作者" data-toggle="tooltip" data-placement="bottom">
                                        <i class="fa fa-user fa-fw"></i>
                                <#if item.original?string('true','false') == 'true'>
                                            刘钊
                                <#else>
                                    ${item.author!'佚名'}
                                </#if>
                                </span>
                                <span class="date" title="文章发表日期" data-toggle="tooltip" data-placement="bottom"><i
                                        class="fa fa-calendar-o fa-fw"></i>${item.createTime?string('yyyy-MM-dd')}</span>
                                <span class="views" title="文章阅读次数" data-toggle="tooltip" data-placement="bottom"><i
                                        class="fa fa-eye fa-fw"></i>浏览(${item.lookCount!(0)})</span>
                                <span class="comment" title="文章评论次数" data-toggle="tooltip" data-placement="bottom">
                                    <a href="${config.siteUrl}/article/${item.id?c}#comment-box"
                                       rel="external nofollow">
                                        <i class="fa fa-comments-o fa-fw"></i>评论(${item.commentCount!(0)})
                                    </a>
                                </span>
                            </span>
                    <div class="clear"></div>
                    <span class="entry-more">
                                <a href="${config.siteUrl}/article/${item.id?c}" rel="bookmark" title="点击查看文章详情"
                                   data-toggle="tooltip" data-placement="bottom">阅读全文</a>
                            </span>
                </div>
            </article>
            </#list>
            <@pageBar></@pageBar>
        <#else >
            <article class="fade-in" style="height: auto">
                <div class="rows">
                    <div class="col-md-10 col-sm-12">
                        <div class="h3 text-center">亲，啥也没找到啊~~<img
                                src="http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/15/j_thumb.gif"
                                alt="[囧]"></div>
                        <div class="h5 text-center">换个姿势，再来一次~~</div>
                    </div>
                    <div class="col-md-2 col-sm-12">
                        <img src="${config.staticWebSite}/images/wrong.gif" class="center-block" alt="惩罚我"
                             style="width: 110px;margin-top: -10px;">
                    </div>
                </div>
                <form action="/" method="post" class="form-horizontal searchForm">
                    <input type="hidden" name="pageNumber" value="1">
                    <div class="input-group">
                        <input type="text" class="form-control br-none" name="keywords" placeholder="换个姿势，再来一次~~">
                        <span class="input-group-btn">
                                <button class="btn btn-default br-none nav-search-btn pointer" type="submit"><i
                                        class="fa fa-search"></i> 搜索</button>
                            </span>
                    </div>
                    <div class="clear" style="margin-bottom: 10px"></div>
                    <ul class="list-unstyled list-inline search-hot">
                        <li><strong style="position: relative;top: 2px;color: #999999;">热门搜索：</strong></li>
                        <li><a class="pointer" rel="external nofollow"><span class="label label-default">Java</span></a>
                        </li>
                        <li><a class="pointer" rel="external nofollow"><span
                                class="label label-primary">Springboot</span></a></li>
                        <li><a class="pointer" rel="external nofollow"><span
                                class="label label-success">Linux</span></a></li>
                        <li><a class="pointer" rel="external nofollow"><span
                                class="label label-info">Maven</span></a></li>
                        <li><a class="pointer" rel="external nofollow"><span
                                class="label label-warning">Bootstrap</span></a></li>
                        <li><a class="pointer" rel="external nofollow"><span
                                class="label label-danger">阿里云</span></a></li>
                    </ul>
                </form>
            </article>
        </#if>
        </div>
    <#include "layout/sidebar.ftl"/>
    <#--按分类推荐-->
        <div class="col-xs-12 col-sm-12 col-md-12 blogweb-container">
            <div class="blogweb-ad" data-position="index_1" style="margin-bottom: 10px;max-height: 135px;"></div>
        </div>
        <div class="col-xs-12 col-sm-6 col-md-6 blogweb-container">
            <div class="blogweb-box">
                <div class="category">
                    <div style="color: #e04620;"><i class="fa fa-fire fa-fw fa-2x"></i>热门文章</div>
                </div>
                <div class="blogweb-content">
                    <div class="row">
                        <div class="col-md-12 col-xs-12 overflow-initial">
                            <ul class="list-unstyled alist">
                            <@articleTag method="hotList" pageSize="6" >
                            <#if hotList?exists && (hotList?size > 0)>
                                <#list hotList as item>
                                    <#if item_index==0>
                                <li class="item-date">${item.createTime?string('MM-dd')}</li>
                                <li class="item-title item-title-0">
                                    <a class="t" href="${config.siteUrl}/article/${item.id?c}"
                                       data-original-title="${item.lookCount!(0)}人浏览了该文章"
                                       data-toggle="tooltip" data-placement="bottom">
                                        ${item.title!''}
                                    </a>
                                    <br>
                                    <div class="item-head">
                                        <figure class="blogweb-thumbnail" style="float: left;margin-right: 20px;">
                                            <a href="${config.siteUrl}/article/${item.id?c}">
                                                <img data-original="${config.staticWebSite}${item.coverImage}"
                                                     class="img-responsive lazy-img" alt="热门文章"
                                                     style="float: left;width: 150px;height: 120px;">
                                            </a>
                                        </figure>
                                        <div class="item-head-desc">${item.description!''}
                                        </div>
                                    </div>
                                </li>
                                    <#else>
                                <li class="item-date">${item.createTime?string('MM-dd')}</li>
                                <li class="item-title item-title-1">
                                    <a class="t" href="${config.siteUrl}/article/${item.id?c}"
                                       data-original-title="${item.lookCount!(0)}人浏览了该文章"
                                       data-toggle="tooltip" data-placement="bottom">
                                        ${item.title!''}
                                    </a>
                                    <br>
                                </li>
                                    </#if>
                                </#list>
                            </#if>
                            </@articleTag>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <@customTag method="subTypes">
        <#if subTypes?? && subTypes?size gt 0>
            <#list subTypes as subType>
                <@articleTag method="typeList" pageSize="6" typeId ="${subType.id}">
                    <#if typeList?exists && (typeList?size > 4)>
        <div class="col-xs-12 col-sm-6 col-md-6 blogweb-container">
            <div class="blogweb-box">
                <div class="category">
                    <div><i class="${subType.icon!''} fa-fw fa-2x"></i>${subType.name}</div>
                </div>
                <div class="blogweb-content">
                    <div class="row">
                        <div class="col-md-12 col-xs-12 overflow-initial">
                            <ul class="list-unstyled alist">
                            <#list typeList as item>
                            <#if item_index==0>
                                <li class="item-date">${item.createTime?string('MM-dd')}</li>
                                <li class="item-title item-title-0">
                                    <a class="t" href="${config.siteUrl}/article/${item.id?c}"
                                       data-original-title="${item.lookCount!(0)}人浏览了该文章"
                                       data-toggle="tooltip" data-placement="bottom">
                                        ${item.title!''}
                                    </a>
                                    <br>
                                    <div class="item-head">
                                        <figure class="blogweb-thumbnail" style="float: left;margin-right: 20px;">
                                            <a href="${config.siteUrl}/article/${item.id?c}">
                                                <img data-original="${config.staticWebSite}${item.coverImage}"
                                                     class="img-responsive lazy-img" alt="热门文章"
                                                     style="float: left;width: 150px;height: 120px;">
                                            </a>
                                        </figure>
                                        <div class="item-head-desc">${item.description!''}
                                        </div>
                                    </div>
                                </li>
                            <#else>
                                <li class="item-date">${item.createTime?string('MM-dd')}</li>
                                <li class="item-title item-title-1">
                                    <a class="t" href="${config.siteUrl}/article/${item.id?c}"
                                       data-original-title="${item.lookCount!(0)}人浏览了该文章"
                                       data-toggle="tooltip" data-placement="bottom">
                                        ${item.title!''}
                                    </a>
                                    <br>
                                </li>
                            </#if>
                            </#list>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
                    </#if>
                </@articleTag>
            </#list>
        </#if>
    </@customTag>
    </div>
</div>
<section class="links index-links">
    <ul class="list-unstyled list-inline">
    <#if indexLinkList?exists && (indexLinkList?size > 0)>
    <#list indexLinkList as item>
        <li>
            <a href="${item.url}" target="_blank" title="${item.description?if_exists}" data-toggle="tooltip"
               data-placement="bottom">
                <img src="${item.favicon}" alt="${item.name?if_exists}"
                     onerror="this.src='${config.staticWebSite}/images/user.png'">${item.name?if_exists}
            </a>
        </li>
    </#list>
        <li>
            <a href="${config.siteUrl}/links" title="更多链接" data-toggle="tooltip" data-placement="bottom"><i
                    class="fa fa-plus"></i>更多链接</a>
        </li>
    <#else>
        <li>
            <a href="${config.siteUrl}/links" title="申请友链" data-toggle="tooltip" data-placement="bottom">申请友链</a>
        </li>
    </#if>
    </ul>
</section>

<@footer></@footer>
